package me.send.data.service.mapper;

import java.math.BigDecimal;

import org.apache.ibatis.annotations.Select;



public abstract interface FinanceMapper {
    
    @Select("select SUM(o.amount) from pay_order o where o.`status`=1")
    public abstract BigDecimal queryPayOrderAmountSum();
    
    @Select("select SUM(l.amount) from activity_fund_pool_log l")
    public abstract BigDecimal queryFundPoolConsumerSum();
    
    @Select("select SUM(o.withdrawAmount) from withdraw_order o where o.`status`=2")
    public abstract BigDecimal queryWithdrawSuccessAmountSum();
    
    @Select("select SUM(o.withdrawAmount) from withdraw_order o where o.`status`=1")
    public abstract BigDecimal queryWithdrawingAmountSum();
    
    @Select("select SUM(o.withdrawAmount) from withdraw_order o where o.`status`=0")
    public abstract BigDecimal queryWithdrawingNotAuthAmountSum();
    
    @Select("select SUM(w.frozenMoney) from broker_wallet w")
    public abstract BigDecimal queryBrokerFrozenAmountSum();
    
    @Select("select SUM(w.purchaseBalance) from broker_wallet w")
    public abstract BigDecimal queryBrokerPurchaseBalanceSum();
    
    @Select("select SUM(w.tipBalance) from broker_wallet w")
    public abstract BigDecimal queryBrokerTipBalanceSum();
    
    @Select("select SUM(l.purchaseAmount) from broker_wallet_log l where l.orderId is NOT NULL")
    public abstract BigDecimal queryBrokerEarnPurchaseAmountSum();
    
    @Select("select SUM(l.tipAmount) from broker_wallet_log l where l.orderId is NOT NULL")
    public abstract BigDecimal queryBrokerEarnTipAmountSum();
    
    @Select("select sum(l.amount) from user_wallet_log l ")
    public abstract BigDecimal queryUserWalletLogSum();
    
    
    
    
    
    
    
    
    
    
} 
